package cn.wolfcode.crm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter
@Setter
public class PurchaseOrder {

    public static final int STATE_AUDIT = 1;  //审核状态
    public static final int STATE_UNAUDIT = 0; //未审核状态

    private Long id;

    private String orderSn;

    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date inputTime;

    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date auditTime;  //确认时间

    private BigDecimal totalNumber;//定单总件数

    private BigDecimal totalAmount;//应付总额

    private BigDecimal payAmount;//实际付款总额

    private int state = STATE_UNAUDIT; //默认为未审核状态

    private Employee inputUser;  //录入人

    private Employee auditor;  //确认人

    private Depot depot;  //仓库

    //采购明细
    private List<PurchaseOrderItem> purchaseOrderItems = new ArrayList<>();
}